#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;

void test(){
    int a = 111;
    [&a](int value){
        ++value;
        cout << "value = " << value << endl;
        ++a;
        cout << "a = " << a << endl;
    }(100);

    cout << "a = " << a << endl;
}

int value1 = 0;
void test1(){
    string name{"wang dao"};
    int age = 100;
    int num = 1;

    [&](int value){
        ++value;
        cout << "value = " << value << endl;
        ++value1;
        cout << "value1 = " << value1 << endl;
        name = "wuhan";
        cout << "name = " << name << endl;
        ++age;
        cout << "age = " << age << endl;
        ++num;
        cout << "num = " << num << endl;
    }(1111);
}

int main()
{
    test();
    test1();
    return 0;
}

